﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Windows.Forms;

namespace UDPServer
{
    static class Program
    {
        public static string ApplicationName = Process.GetCurrentProcess().ProcessName;

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            //bool bFindProcess = true;
            //int iCheckRunTimes = 0;
            //while (iCheckRunTimes < 5)
            //{
            //    int ProcessCount = Process.GetProcessesByName(ApplicationName).Length;
            //    if (ProcessCount == 1)
            //    {
            //        bFindProcess = false;
            //        break;
            //    }
            //    iCheckRunTimes++;
            //    Thread.Sleep(300);
            //}
            //if (bFindProcess)
            //{ 
            //    return;
            //} 

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FrmServer frm = new FrmServer();
            Application.Run(frm);

        }
    }
}
